using System;
using System.Collections.Generic;
using System.Text;

using Open.Data.Persistence;

using Open.Data.Persistence.SqlServer;

namespace Open.Data.Persistence.Testing
{
    [IndexColumns("LastNames, FirstNames")]
    public class Person: Table
    {
        //Property variables
        private int _id;
        private string _firstNames;
        private string _lastNames;
        private DateTime? _dateOfBirth;
        private Phone _phone;

        #region Interface

        public Person()
        {

        }

        [PrimaryKey]
        public virtual int Id
        {
            get
            {
                return _id;
            }
            set
            {
                _id = value;
            }
        }

        [Column, SqlLength(80)]
        public virtual string FirstNames
        {
            get
            {
                return _firstNames;
            }
            set
            {
                _firstNames = value;
            }
        }

        [Column, Index, SqlLength(255)]
        public string LastNames
        {
            get
            {
                return _lastNames;
            }
            set
            {
                _lastNames = value;
            }
        }

        [Column]
        public Nullable<DateTime> DateOfBirth
        {
            get
            {
                return _dateOfBirth;
            }
            set
            {
                _dateOfBirth = value;
            }
        }

        [Column]
        public Phone Phone
        {
            get
            {
                return _phone;
            }
            set
            {
                _phone = value;
            }
        }

        #endregion
    }
}